-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eofparse: Return number of errors #873
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #873 +/- ##
=======================================
Coverage 98.38% 98.39%
=======================================
Files 129 130 +1
Lines 15578 15615 +37
=======================================
+ Hits 15327 15364 +37
Misses 251 251
Flags with carried forward coverage won't be shown. Click here to find out more.
|
cc4ca1e
to
bdaa2bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, one idea for a test
add_test(NAME ${PREFIX}/eof_version_unknown COMMAND sh -c "echo EF00.FF | ${CROSSCOMPILING_EMULATOR} $<TARGET_FILE:evmone-eofparse>") | ||
set_tests_properties(${PREFIX}/eof_version_unknown PROPERTIES PASS_REGULAR_EXPRESSION "err: eof_version_unknown") | ||
|
||
add_test(NAME ${PREFIX}/invalid_hex COMMAND sh -c "echo gaga | ${CROSSCOMPILING_EMULATOR} $<TARGET_FILE:evmone-eofparse>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to test the new behavior, would a command like echo <code1> \n <invalid_code2> \n <invalid_code3> | eofparse || echo $?
and then assert that 2 got printed in the end work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I didn't know how to test the exit code...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Maybe something like <eofparse> > /dev/null; echo $?
would be more robust, just assert result is exactly 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did exactly this. Hopefully, there will be no issues with shell on different OSes.
b69d978
to
1e07c7f
Compare
In the evmone-eofparse tool exit with the number of invalid EOFs encountered. Also add some basic integration tests.
In the evmone-eofparse tool exit with the number of invalid EOFs encountered.
Also add some basic integration tests.
Fixes #872